package com.xshiwu.es.test;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * @Project: es
 * @Author: Sunday
 * @Create: 2021-09-03 17:02
 **/
public class EsTest_Client {
    public static void main(String[] args) throws Exception {
        // 创建客户端对象
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(new HttpHost("localhost", 9200, "http")));
        // 关闭客户端连接
        client.close();
    }
}
